package com.linwen.javase.desgin_pattern.BigTalkDesignPattenJAVACode._03装饰模式._6装饰器_策略工厂;

/**
 * @ClassName CashSuper
 * @Description TODO
 * @Author zero
 * @DATE 2023/7/10 11:26 PM
 * @Version 1.0
 */
public class CashSuper implements ISale{
    protected ISale iSale;


    public void decorate(ISale iSale) {
        this.iSale = iSale;
    }

    @Override
    public double acceptCash(double price,int num){
        double result = 0d;
        if(this.iSale!=null){
            result = this.iSale.acceptCash(price, num);
        }
        return result;
    }
}
